home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / OSPROC.H < prev    next >
C/C++ Source or Header  |  1992-03-26  |  5KB  |  127 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/src/microcode/RCS/osproc.h,v 1.7 1992/03/26 10:54:49 cph Exp $
  4.  
  5. Copyright (c) 1990-92 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. #ifndef SCM_OSPROC_H
  36. #define SCM_OSPROC_H
  37.  
  38. #include "os.h"
  39.  
  40. typedef unsigned int Tprocess;
  41.  
  42. enum process_status
  43. {
  44.   process_status_free,        /* unused process table entry */
  45.   process_status_allocated,    /* being started */
  46.   process_status_running,    /* running */
  47.   process_status_stopped,    /* stopped but continuable */
  48.   process_status_exited,    /* terminated by calling _exit() */
  49.   process_status_signalled    /* terminated by being signalled */
  50. };
  51.  
  52. enum process_jc_status
  53. {
  54.   process_jc_status_no_ctty,    /* job has no control terminal */
  55.   process_jc_status_unrelated,    /* job's ctty different from Scheme's */
  56.   process_jc_status_no_jc,    /* job has same ctty, jc not available */
  57.   process_jc_status_jc        /* job has same ctty, jc available */
  58. };
  59.  
  60. enum process_ctty_type
  61. {
  62.   /* No controlling terminal.
  63.      Used for batch jobs, similar to `nohup' program. */
  64.   process_ctty_type_none,
  65.  
  66.   /* Use Scheme's controlling terminal, run in background. */
  67.   process_ctty_type_inherit_bg,
  68.  
  69.   /* Use Scheme's controlling terminal, run in foreground. */
  70.   process_ctty_type_inherit_fg,
  71.  
  72.   /* Use given controlling terminal, usually a PTY. */
  73.   process_ctty_type_explicit
  74. };
  75.  
  76. enum process_channel_type
  77. {
  78.   process_channel_type_none,
  79.   process_channel_type_inherit,
  80.   process_channel_type_ctty,
  81.   process_channel_type_explicit
  82. };
  83.  
  84. extern size_t OS_process_table_size;
  85. #define NO_PROCESS OS_process_table_size
  86. extern enum process_jc_status scheme_jc_status;
  87.  
  88. extern Tprocess EXFUN
  89.   (OS_make_subprocess,
  90.    (CONST char * filename,
  91.     char * CONST * argv,
  92.     char * CONST * env,
  93.     CONST char * working_directory,
  94.     enum process_ctty_type ctty_type,
  95.     char * ctty_name,
  96.     enum process_channel_type channel_in_type,
  97.     Tchannel channel_in,
  98.     enum process_channel_type channel_out_type,
  99.     Tchannel channel_out,
  100.     enum process_channel_type channel_err_type,
  101.     Tchannel channel_err));
  102. extern void EXFUN (OS_process_deallocate, (Tprocess process));
  103.  
  104. extern int EXFUN (OS_process_valid_p, (Tprocess process));
  105. extern int EXFUN (OS_process_continuable_p, (Tprocess process));
  106. extern int EXFUN (OS_process_foregroundable_p, (Tprocess process));
  107.  
  108. extern pid_t EXFUN (OS_process_id, (Tprocess process));
  109. extern enum process_jc_status EXFUN (OS_process_jc_status, (Tprocess process));
  110. extern int EXFUN (OS_process_status_sync, (Tprocess process));
  111. extern int EXFUN (OS_process_status_sync_all, (void));
  112. extern enum process_status EXFUN (OS_process_status, (Tprocess process));
  113. extern unsigned short EXFUN (OS_process_reason, (Tprocess process));
  114.  
  115. extern void EXFUN (OS_process_send_signal, (Tprocess process, int sig));
  116. extern void EXFUN (OS_process_kill, (Tprocess process));
  117. extern void EXFUN (OS_process_stop, (Tprocess process));
  118. extern void EXFUN (OS_process_interrupt, (Tprocess process));
  119. extern void EXFUN (OS_process_quit, (Tprocess process));
  120. extern void EXFUN (OS_process_hangup, (Tprocess process));
  121.  
  122. extern void EXFUN (OS_process_continue_background, (Tprocess process));
  123. extern void EXFUN (OS_process_continue_foreground, (Tprocess process));
  124. extern void EXFUN (OS_process_wait, (Tprocess process));
  125.  
  126. #endif /* SCM_OSPROC_H */
  127.